import request from '@/utils/request'

// 获取用户信息
export function getDepartments(doc) {
  return request({
    url: '/company/department',
    doc,
  })
}

// 删除部门
export function delDepts(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE',
  })
}

// 新增部门
export function addDepts(data, doc) {
  return request({
    url: '/company/department',
    method: 'POST',
    data,
    doc,
  })
}

// 根据ID查询部门详情信息
export function getDeptsById(id, doc) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET',
    doc,
  })
}

// 修改部门
export function updateDeptsById({ id, ...data }) {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT',
    data,
  })
}
